<?php
	date_default_timezone_set('America/New_York');
	require_once("/public_header.php");
	require_once("/globals.php");
	if(adminIsLoggedIn()):
		redirectAdminToAdminPage();
	else:
		if($_SERVER['REQUEST_METHOD'] == 'POST'):
			$username = sanitizeString($_POST['admin_username']);
			$password = sanitizeString($_POST['password']);			
			
			login($username, $password);
			exit;
		elseif ($_SERVER['REQUEST_METHOD'] == 'GET'):
			require_once("admin_login_form.html");
		endif;
	endif;	
?>